package net.azure.app.model;

import java.util.LinkedList;
import java.util.List;


/**
 * Created by IntelliJ IDEA.
 * User: Venkatraman Kandaswamy kvenkatraman@gmail.com
 * Date: 12-Jun-2008
 * Time: 06:49:22
 */
public class StoryDetails implements IModel{
    String asA;
    String wantTo;
    String soThat;
    String details;
    String comments;
    String queries;
    String notes;

    final int asAPosition = 0;
    final int wantToPosition = 1;
    final int soThatPosition = 2;
    final int detailsPosition = 3;
    final int estimationCommentsPosition = 4;
    final int estimationQueriesPosition = 5;
    final int estimationNotesPosition = 6;

    public StoryDetails(int offset, String... varArgs) {
        this.asA = varArgs[asAPosition+offset];
        this.wantTo = varArgs[wantToPosition+offset];
        this.soThat = varArgs[soThatPosition+offset];
        this.details = varArgs[detailsPosition+offset];
        this.comments = varArgs[estimationCommentsPosition+offset];
        this.notes = varArgs[estimationNotesPosition+offset];
        this.queries = varArgs[estimationQueriesPosition+offset];
    }

    @Override
    public Object field(int position) {
        switch(position){
            case asAPosition : return asA;
            case wantToPosition : return wantTo;
            case soThatPosition : return soThat;
            case detailsPosition : return details;
            case estimationCommentsPosition : return comments;
            case estimationNotesPosition : return notes;
            case estimationQueriesPosition : return queries;
        }
        return null;
    }

    public int fieldsCount(){
        return estimationQueriesPosition;  
    }

    @Override
    public List<String> header() {
        List<String> header = new LinkedList<String>();
        header.add("As A");
        header.add("Want To");
        header.add("So That");
        header.add("Details");
        header.add("Comments");
        header.add("Notes");
        header.add("Queries");
        return header;
    }

    public String getAsA() {
        return asA;
    }

    public void setAsA(String asA) {
        this.asA = asA;
    }

    public String getWantTo() {
        return wantTo;
    }

    public void setWantTo(String wantTo) {
        this.wantTo = wantTo;
    }

    public String getSoThat() {
        return soThat;
    }

    public void setSoThat(String soThat) {
        this.soThat = soThat;
    }

    public String getDetails() {
        return details;
    }

    public void setDetails(String details) {
        this.details = details;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public String getQueries() {
        return queries;
    }

    public void setQueries(String queries) {
        this.queries = queries;
    }    
}
